<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>MegaZeux Platform Support Matrix</title>
<script language="JavaScript">

function note_link(note) {
  return '<a href="#note' + note + '">[' + note + ']</a>';
}

function defunct(_v) {
  // Historically supported platform
  return _v + note_link(1);
}

function _yes(_v="YES") {
  // Ideal
  return {c: "yes", v: _v};
}

function std(_v, note=0) {
  // Normal
  if(note) _v += note_link(note);
  return {c: "std", v: _v};
}

function subopt(_v="NO", note=0)
{
  // Supoptimal, trivially fixable
  if(note) _v += note_link(note);
  return {c: "no2", v: _v};
}

function _FAULTY(_v="NO", note=0)
{
  // Faulty, not trivially fixable
  if(note) _v += note_link(note);
  return {c: "no", v: _v};
}

// Some common values
var yes = _yes();
var no = std("NO");

var no_mingw_stack_protector = subopt("NO", 4);
var no_low_memory = subopt("NO", 5);
var no_updater = subopt("NO", 6);
var no_updater_unix = subopt("NO", 7);
var no_sdl_3ds = std("NO", 9);
var optional_sdl_wii = std("OPTIONAL", 10);
var yes_with_sdl = subopt("YES (SDL)", 10);
var yes_but_8bpp = subopt("YES (8bpp)", 11);

var ZIP = _yes("ZIP");
var DMG = _yes("DMG");
var LHA = _yes("LHA");

var xmp = std("xmp");
var libvorbis = std("libvorbis");
var tremor = "tremor";

var render_ctr = std("render_ctr");
var render_nds = std("render_nds");
var render_gp2x = std("render_gp2x");
var render_gx = std("render_gx");

var speed = "Speed";
var size = "Size";


var fields =
{
  platform:         "$PLATFORM",
  description:      "Description",
  architecture:     "Architecutre(s)<br />(Tested Only)",
  endian:           "Endian",
  toolchain:        "Toolchain",
  packaged:         "Packaged",
  visibility:       "Optimized Visibility" + note_link(3),
  stack_protector:  "Stack Protector",
  layer_rendering:  "Layer Rendering",
  module_engine:    "Module Engine",
  ogg_vorbis:       "Ogg Vorbis",
  optimization:     "Optimization",
  sdl:              "SDL",
  editor:           "EDITOR",
  helpsys:          "HELPSYS",
  audio:            "AUDIO",
  software:         "SOFTWARE",
  gl:               "GL",
  overlay:          "OVERLAY",
  glsl:             "GLSL",
  updater:          "UPDATER",
  modular:          "MODULAR",
  png:              "PNG",
  x11:              "X11",
  uthash:           "UTHASH",
  loadsave_meter:   "LOADSAVE_METER",
};

var archs =
{
  _3ds:
  {
    platform:         "3ds",
    description:      "Nintendo 3DS",
    architecture:     "ARM11 (ELF)",
    endian:           "Little",
    toolchain:        "gcc 7.1.0 <br /> binutils 2.28 <br /> (dk r47)",
    packaged:         ZIP,
    stack_protector:  _FAULTY(),
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       tremor,
    optimization:     speed,
    sdl:              no_sdl_3ds,
    editor:           no_low_memory,
    helpsys:          no_low_memory,
    audio:            yes,
    software:         render_ctr,
    updater:          no_updater,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   yes,
  },

  darwin:
  {
    platform:         "darwin",
    description:      "MacOS 10.x",
    architecture:     "x86_64 (Mach-O) <br /> i686 (Mach-O) <br /> PPC (Mach-O)",
    endian:           "Varies",
    toolchain:        "FIXME",
    packaged:         DMG,
    visibility:       yes,
    stack_protector:  yes,
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       libvorbis,
    optimization:     speed,
    sdl:              yes,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         yes,
    gl:               yes,
    overlay:          yes,
    glsl:             yes,
    updater:          no_updater,
    modular:          yes,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   no,
  },

  mingw:
  {
    platform:         "mingw",
    description:      "Windows <br /> (GNU toolchain)",
    architecture:     "x64 (PE+ COFF) <br /> x86 (PE COFF)",
    endian:           "Little",
    toolchain:        "gcc 7.2.0 <br /> binutils 2.29.1",
    packaged:         ZIP,
    visibility:       yes,
    stack_protector:  no_mingw_stack_protector,
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       libvorbis,
    optimization:     speed,
    sdl:              yes,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         yes,
    gl:               yes,
    overlay:          yes,
    glsl:             yes,
    updater:          yes,
    modular:          yes,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   no,
  },

  msvc:
  {
    platform:         "msvc",
    description:      "Windows <br /> (Visual Studio)",
    architecture:     "x64 (PE+ COFF) <br /> x86 (PE COFF)",
    endian:           "Little",
    toolchain:        "Visual Studio 2017",
    packaged:         subopt("NO", 2),
    visibility:       yes,
    stack_protector:  _FAULTY(),
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       libvorbis,
    optimization:     speed,
    sdl:              yes,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         yes,
    gl:               yes,
    overlay:          yes,
    glsl:             yes,
    updater:          yes,
    modular:          yes,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   no,
  },

  nds:
  {
    platform:         "nds",
    description:      "Nintendo DS",
    architecture:     "ARM9 (ELF)",
    endian:           "Little",
    toolchain:        "gcc 7.1.0 <br /> binutils 2.28 <br /> (dk r47)",
    packaged:         ZIP,
    stack_protector:  _FAULTY(),
    layer_rendering:  _FAULTY(),
    module_engine:    _FAULTY(),
    ogg_vorbis:       _FAULTY(),
    optimization:     size,
    sdl:              no,
    editor:           no_low_memory,
    helpsys:          no_low_memory,
    audio:            _FAULTY(),
    software:         render_nds,
    updater:          no_updater,
    png:              no_low_memory,
    uthash:           no_low_memory,
    loadsave_meter:   yes,
  },

  psp:
  {
    platform:         "psp",
    description:      "PlayStation Portable",
    architecture:     "MIPS (ELF)",
    endian:           "Little",
    toolchain:        "gcc 4.6.2 <br /> binutils 2.22 <br /> (dk r16)",
    packaged:         ZIP,
    stack_protector:  _FAULTY(),
    layer_rendering:  yes_but_8bpp,
    module_engine:    xmp,
    ogg_vorbis:       tremor,
    optimization:     size,
    sdl:              yes,
    editor:           no_low_memory,
    helpsys:          no_low_memory,
    audio:            yes,
    software:         yes,
    updater:          no_updater,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   yes,
  },

  unix:
  {
    platform:         "unix",
    description:      "Linux, BSD, Solaris, HaikuOS, etc.",
    architecture:     "AMD64 (ELF) <br /> i386 (ELF) <br /> PPC64 (ELF)",
    endian:           "Varies",
    toolchain:        "Various",
    packaged:         _yes("Various"),
    visibility:       yes,
    stack_protector:  yes,
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       libvorbis,
    optimization:     speed,
    sdl:              yes,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         yes,
    gl:               yes,
    overlay:          yes,
    glsl:             yes,
    updater:          no_updater_unix,
    modular:          yes,
    png:              yes,
    x11:              yes,
    uthash:           yes,
    loadsave_meter:   no,
  },

  wii:
  {
    platform:         "wii",
    description:      "Nintendo Wii",
    architecture:     "PPC (ELF)",
    endian:           "Big",
    toolchain:        "gcc 6.3.0 <br /> binutils 2.27 <br /> (dk r29)",
    packaged:         ZIP,
    stack_protector:  _FAULTY(),
    layer_rendering:  yes_with_sdl,
    module_engine:    xmp,
    ogg_vorbis:       tremor,
    optimization:     speed,
    sdl:              optional_sdl_wii,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         render_gx,
    updater:          no_updater,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   yes,
  },

  xcode:
  {
    platform:         "xcode",
    description:      ">= MacOS 10.6",
    architecture:     "x86_64 (Mach-O) <br /> i686 (Mach-O)",
    endian:           "Little",
    toolchain:        "clang 900.0.38 <br /> LLVM 9.0.0",
    packaged:         DMG,
    visibility:       yes,
    stack_protector:  yes,
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       libvorbis,
    optimization:     speed,
    sdl:              yes,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         yes,
    gl:               yes,
    overlay:          yes,
    glsl:             yes,
    updater:          no_updater,
    modular:          yes,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   no,
  },

  _0: "spacer",

  amiga:
  {
    platform:         defunct("amiga"),
    description:      "AmigaOS 4.x",
    architecture:     "PPC (ELF)",
    endian:           "Big",
    toolchain:        "gcc 4.2.2 <br /> binutils 2.14 <br /> clib2",
    packaged:         LHA,
    visibility:       yes,
    stack_protector:  yes,
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       libvorbis,
    optimization:     speed,
    sdl:              yes,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         yes,
    gl:               yes,
    overlay:          yes,
    glsl:             yes,
    updater:          no_updater,
    modular:          yes,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   no,
  },

  android:
  {
    platform:         defunct("android"),
    description:      "Android",
    architecture:     "ARMv7-a (ELF) <br /> i686 (ELF)",
    endian:           "Little",
    toolchain:        "gcc 4.2.1 <br /> binutils 2.17 <br /> bionic",
    packaged:         _FAULTY("TBD", 8),
    visibility:       yes,
    stack_protector:  _FAULTY("NO", 8),
    layer_rendering:  _FAULTY("NO", 8),
    module_engine:    xmp,
    ogg_vorbis:       tremor,
    optimization:     size,
    sdl:              no,
    editor:           yes,
    helpsys:          yes,
    audio:            _FAULTY("TBD", 8),
    software:         no,
    gl:               yes,
    overlay:          _FAULTY("NO", 8),
    glsl:             yes,
    updater:          no_updater,
    modular:          yes,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   no,
  },

  gp2x:
  {
    platform:         defunct("gp2x"),
    description:      "GP2x",
    architecture:     "ARM9 (ELF)",
    endian:           "Little",
    toolchain:        "gcc 4.1.1 <br /> binutils 2.16.1 <br /> glibc2.3.7 <br /> (open2x)",
    packaged:         ZIP,
    stack_protector:  _FAULTY(),
    layer_rendering:  _FAULTY(),
    module_engine:    xmp,
    ogg_vorbis:       tremor,
    optimization:     size,
    sdl:              yes,
    editor:           no_low_memory,
    helpsys:          no_low_memory,
    audio:            yes,
    software:         render_gp2x,
    updater:          no_updater,
    png:              yes,
    uthash:           yes,
    loadsave_meter:   yes,
  },

  pandora:
  {
    platform:         defunct("pandora"),
    description:      "Pandora",
    architecture:     "ARMv7-a (ELF)",
    endian:           "Little",
    toolchain:        "gcc 4.4.1 <br /> binutils 2.19.51 <br /> (CS 2009q3)",
    packaged:         subopt("ZIP (PND?)"),
    visibility:       yes,
    stack_protector:  yes,
    layer_rendering:  yes,
    module_engine:    xmp,
    ogg_vorbis:       tremor,
    optimization:     speed,
    sdl:              yes,
    editor:           yes,
    helpsys:          yes,
    audio:            yes,
    software:         yes,
    gl:               _FAULTY(),
    overlay:          _FAULTY(),
    glsl:             _FAULTY(),
    updater:          no_updater,
    png:              yes,
    x11:              subopt(),
    uthash:           yes,
    loadsave_meter:   no,
  },

/*
  your_arch_here:
  {
    platform:         
    description:      
    architecture:     
    endian:           
    toolchain:        
    packaged:         
    visibility:       
    stack_protector:  
    module_engine:    
    ogg_vorbis:       
    optimization:     
    sdl:              
    editor:           
    helpsys:          
    audio:            
    software:         
    gl:               
    overlay:          
    glsl:             
    updater:          
    modular:          
    png:              
    x11:              
    uthash:           
    loadsave_meter:   
  },
*/
};

function build_table()
{
  var content = ""
  var i = 0;

  function th(_data)
  {
    content += '<th>';

    if(typeof(_data) === 'object')
    {
      content += _data.v;
    }
    else

    if(typeof(_data) === 'string')
    {
      content += _data;
    }

    else
    {
      content += 'N/A';
    }
    content += '</th>\n';
  }

  function td(_data)
  {
    if(typeof(_data) === 'object')
    {
      content += '<td class="' + _data.c + '">';
      content += _data.v;
    }
    else

    if(typeof(_data) === 'string')
    {
      content += '<td>';
      content += _data;
    }

    else
    {
      content += '<td class="na">';
      content += 'N/A';
    }
    content += '</td>\n';
  }

  function spacer()
  {
    content += '<td class="spacer"></td>\n';
  }

  for(var f in fields)
  {
    content += '<tr>\n';
    th(fields[f]);

    if(i == 0)
    {
      // Header row
      for(var a in archs)
      {
        if(archs[a] === "spacer")
          spacer();

        else
          th(archs[a][f]);
      }

      i = 1;
    }
    else
    {
      // Data row
      for(var a in archs)
      {
        if(archs[a] === "spacer")
          spacer();

        else
          td(archs[a][f]);
      }
    }

    content += "</tr>\n";
  }

  document.getElementById('matrix').innerHTML = content;
}

window.onload = build_table;

</script>
<style type="text/css">
body {
	font-family : "Verdana", "Bitstream Vera Sans";
	margin-left : 1em;
	margin-right : 1em;
	font-size : 9pt;
}

p#legend {
	margin-left : 1em;
	margin-right : 1em;
}

table {
	border-collapse : collapse;
	border : 2px solid black;
	border-spacing : 0;
	width : 150em;
}

td, th {
	text-align : center;
	border-width : 1px 1px 1px 1px;
	border-style : inset inset inset inset;
	border-color : gray;
	padding : 5px;
	color : black;
	width : 8.3%;
}

td {
	vertical-align : top;
}

th {
	background-color : rgb(200,200,200);
}

td.yes, td.no, td.no2, td.na, td.std {
	vertical-align : middle;
}

span.yes, span.no, span.no2, span.na, span.std {
	border : 1px solid black;
	padding-right : 1em;
	padding-left : 1em;
}

.yes {
	background-color : rgb(0,255,0);
}

.no {
	background-color : rgb(255,0,0);
	font-weight : bold;
	color : white;
}

.no2 {
	background-color : rgb(255,150,150);
	color : black;
}

.na {
	background-color : rgb(220,220,200);
}

.std {
	background-color : rgb(150,255,150);
}

.spacer {
  border-top : none;
  border-bottom : none;
  padding-left : 10px;
  width : 2%;
}

a {
	font-weight : normal;
	font-size : 8pt;
}

li {
	padding : 2px;
	width : 50%;
}
</style>
</head>

<body>

<h1>MegaZeux Platform Support Matrix</h1>
<p>Best viewed with &gt;=1920 pixel monitor. Requires Javascript.</p>

<p id="legend">
<b>Legend:</b>
<span class="yes">Ideal</span>
<span class="std">Normal</span>
<span class="na">Not applicable</span>
<span class="no2">Suboptimal, Trivially fixable</span>
<span class="no">Faulty, Not trivially fixable</span>
</p>

<table id="matrix"></table>

<h3>Platform Notes</h3>

<ol>

<li><a name="note1"/>These platforms are currently unsupported due to lack
of available hardware to test on, lack of working toolchains, inherent
compatibility issues with MegaZeux, or simply lack of interest. Information
based on last known working builds (if any).
</li>

<li><a name="note2"/>Could use existing `package.sh' however this does
not handle PDB files.<br/>
MSVC binaries are replicate of MinGW binaries and require a proprietary non
cross-capable compiler.
</li>

<li><a name="note3"/>&quot;Optimized Visibility&quot; refers to the
hiding of library symbols which are not required or referenced
outside of that library. An &quot;optimized&quot; library is smaller
and loads faster.<br/>
Required on Win32. Only applicable with CONFIG_MODULAR=y builds.
</li>

<li><a name="note4"/>Disabled due to miscompilation of stack protector in
conjunction with C++ exceptions with some MinGW compilers.
</li>

<li><a name="note5"/>The editor and help system features are disabled
to conserve cache on embedded platforms. The features build and work
on these platforms, but they are basically unusable due to the lack of any
on-screen keyboard. Additionally, uthash has been disabled on the NDS to
conserve memory.
</li>

<li><a name="note6"/>The updater may or may not work on these platforms, but
no builds are currently provided by the official update hosts.
</li>

<li><a name="note7"/>The updater is typically disabled in the Linux
binaries that are shipped (for distributions like Debian or Fedora), even
though the feature can easily be enabled.<br/>The issue is that MegaZeux is
installed system-wide on these platforms and overwrites cannot be
guaranteed.<br/>Additionally, it is felt that the advanced package management
on these platforms supercedes any usefulness of the built-in updater.
</li>

<li><a name="note8"/>The Android platform, while having been listed in this
table for a long time, has never really been supported. What little work exists
is extremely old, and no viable build has ever been created.
</li>

<li><a name="note9"/>Building MZX with SDL on the 3DS is viable, but the
software renderer is far slower, currently offers no additional functionality,
and doesn't allow for special features such as screen dragging. Furthermore,
SDL significantly increases the size of the MZX executable.
</li>

<li><a name="note10"/>Building MZX with SDL Wii is viable, but produces larger
binaries than desired, relies on the slow SDL software renderer, and SDL Wii is
considered unstable. However, the SDL software renderer supports all layer
rendering features (unlike the gx renderer) and the regular Wii port is
currently non-functional, so SDL is currently the better option.
</li>

<li><a name="note11"/>Layer rendering is supported on this platform by as it
uses the SDL software renderer, but this port does not currently support a color
depth greater than 8bpp, so the UI palette will not be protected in SMZX mode.
</li>
</ol>

<h3>Copyright</h3>

<p>This document may be copied and redistributed without limitation
or reservation.</p>

</body>

</html>
